Linux

Last modified by Peio Rigaux on 2022/04/14 16:58

Installation

Centos7

As of January 2017, only outdated packages provided by the Centos7 distribution are available. Therefore, we recommend to compile linphone from sources

Debian

As of January 2017, only outdated packages provided by the Debian distribution are available. Therefore, we recommend to compile linphone from sources

From source

To compile Linphone from sources, follow download instructions from section Source code of linphone web site.

Then, follow the compilation instructions from the README file available at project root

Documentation

Liblinphone API reference documentations are available for each supported language.

Compilation

When installating from source, make sure to have /lib/pkgconfig  in variable PKG_CONFIG_PATH.
If this variable is correctly set, the following command should display liblinphone version:

pkg-config modversion linphone

Copy helloworld.c tutorial to current directory

cp $(pkg-config variable=prefix linphone)/share/tutorials/linphone/helloworld.c .

Linux

gcc -o helleworld helloworld.c $(pkg-config libs cflags linphone)

Test

A sip bot is available at sip:bot.linphone.org. helloword can be tested with this bot:
helloworld sip:bot.linphone.org 

Troubleshooting

Something wrong ? how to debug ?

Initial step when trying to understand underlying behavior is to enable debug traces using function linphone_core_set_log_level_mask.
Value ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL outputs all traces to stdout.

Result shall be like below:

 ./helloworld sip:bot.linphone.org
2015-05-19 17:22:03:942 ortp-message-Initializing LinphoneCore 3.8.2-38-g6eeff52
2015-05-19 17:22:03:943 ortp-message-Vtable [0x7fc05a800400] registered on core [0x7fc059d0c4e0]
2015-05-19 17:22:03:944 ortp-message-Linphone core [0x7fc05a800400] notifying [global_state_changed]
2015-05-19 17:22:03:944 ortp-message-oRTP-0.24.2 initialized.
2015-05-19 17:22:03:945 ortp-message-Mediastreamer2 factory 2.11.2 (git: 2.11.2-16-gebf5adc) initialized.
2015-05-19 17:22:03:945 ortp-message-CPU count set to 4
2015-05-19 17:22:03:945 ortp-message-ms_factory_init() done
2015-05-19 17:22:03:946 ortp-message-srtp init
2015-05-19 17:22:03:957 ortp-message-Registering all soundcard handlers
2015-05-19 17:22:04:005 ortp-message-CA: devname:Built-in Microphone uidname:AppleHDAEngineInput:1B,0,1,0:1
2015-05-19 17:22:04:005 ortp-message-Format for [lpcm] rate [44100] channels [2]
2015-05-19 17:22:04:005 ortp-message-Card 'AudioUnit: Built-in Microphone' added
2015-05-19 17:22:04:006 ortp-message-CA: devname:Built-in Input uidname:AppleHDAEngineInput:1B,0,1,1:2
2015-05-19 17:22:04:006 ortp-message-Format for [lpcm] rate [44100] channels [2]
2015-05-19 17:22:04:006 ortp-message-Card 'AudioUnit: Built-in Input' added
...

tcpdump is often a good tool to troubleshoot SIP issues.

tcpdump -nqt -s 0 -A -i any port 5060